 |
7.3 Editing Campaign Files
This section describes how to modify the campaigns in
Apache Havoc. It should not be taken as a complete guide or manual but it should go some
way to assist the keen hacker. This information is courtesy of Todd Gibbs at Razorworks.
Note: If altering any files causes problems with the
game, either restore from backups or the original files located on the CD.
Directory Structure
Each campaign uses similar files but stored in their
own sub-directory.

figure 7-1: Campaign Directories |
Map Numbers and their Location MAP1 is Thailand
MAP2 is Cuba
MAP3 is Georgia
|
CUBA (Map #2) as an Example
There are several files in each MAP# directory, their file extensions denote their
usage:
- CMP (campaign)
- DEM (demo)
- FRE (free flight)
- SGL and SPC (single and special games).
The CMP files are the most use for quickly changing the balance of power although
some others can influence it.
CUBA.CMP
The CMP files are mostly self-explanatory but here is a quick run down the contents:
The attitude is not used at the moment but will be in Comanche Hokum. Its will
influence the sides retaliation characteristics.
The task_generation stuff defines the type of tasks a side can create, the values after
it aren't used. They use to deal with frequency, urgency and duration but never made it
in.
Hardware reserves I think you can guess. During the campaign these are spawned in base
"Generator Hangers". Out of these you will see helicopters and jets taxiing to
the landing pads. The frequency of replacements from the reserves is defined by REGEN_FREQUENCY, its value is
defined as:
time to regen = 10 minutes /
REGEN_FREQUENCY
With 1 giving a new aircraft every 10 minutes and 10 giving one every minute. You'll
notice that the BLUE FORCE regen frequency is a lot lower to try and address the balance.
The actual size of the groups of tanks is defined by how big the area is that they are
being placed into (clear area around the road node), but the maximum they will ever get is
defined by FRONTLINE_FORCES. The default is 10 and the max is 16. You could try giving the
US 12 and the CIS 6 and see what happens.... If you try 16/16 you'll probably see a large
frame-rate drop, especially on Thailand (by default there is 1000 tanks already!)
From there on its all about bases (keysites) and the initial forces at them. You've
pretty much worked out how the groups are built and what goes into them (from formcomp.dat
and forms.dat). This will influence the war quite a bit. At the moment no ground forces
are placed this way, they are either done automatically by the Frontline code or SAM/AAA
placement code. I'll have a look next week and see if I can provide some help in tweaking
these.
You could try placing some tanks at a base and see what happens, although the only task
they would be able to pickup is 'Supply'...
I probably need to explain how the task engine works as well... everything in the world
is capable of doing a task (mission). Obviously some things are more suitable for certain
tasks than others. When a task is created (by either the Highlevel AI or the Retaliation
engine - another subject ;) ) it goes onto an "unassigned_mission" list. This
list is periodically assessed by idle groups in the world to see if there is anything for
them to do. When assessing they take into account their 'suitability' values and,
hopefully, a suitable match is made.
The Highlevel AI deals with planned attacks or missions, like Deep strike (not all of
them) or CAP. The Retaliation engine probably creates most of the mission in the game.
Each side has a Retaliation engine that is informed if anything happens, like a tank
targeting a helicopter. The Retaliation engine decides if the tank should attack, hide or
if it should send in some forces to help (or whatever...) and on the other side if the
helicopter should attack back, run away or if it should send assistance.
CUBA.SID
There is also a file called CUBA.SID
This is a multi-layered PSD (Adobe PhotoShop file) that has simply been renamed. If
you rename it back to CUBA.PSD and
load it up you'll see that the file has a number of layers.
The layers are:
.PSD Layer Name |
Description |
BACKGROUND |
Defines the red/blue
initial land held |
BLUE_HOT_SPOTS |
defines the objective
sectors (the ones you need to capture to win) |
RED_HOT_SPOTS |
defines the objective
sectors (the ones you need to capture to win) |
BLUE_GROUND_WARMTH |
Greyscale, used by the
ground forces to know which way to move, |
RED_GROUND_WARMTH |
(Cold to warmer, White
being the warmest) |
BLUE_SEA_WARMTH |
Not Used |
RED_SEA_WARMTH |
Not Used |
You should be able to draw on this, rename it back to CUBA.SID and see the changes... it would help a lot if you just gave
the BLUE_FORCE side more land!
FORMS.DAT
FORMS.DAT contains all the campaign formations, unfortunately you can't add new
formations, only alter the existing ones. I guess the easiest way to work out new
formation positions is on graph paper, (that's how it was done). I don't think the Kiev
and Tarawa ones are used any more so you could totally alter those (change name etc).
Here’s the complete list of available formations in case any are missing from the
file:
NONE,
1,
2_ROW_LEFT,
2_ROW_RIGHT,
2_COLUMN,
2_VERTICAL,
3_ROW_LEFT,
3_ROW_RIGHT,
3_COLUMN,
3_VERTICAL,
3_VEE,
4_ROW_LEFT,
4_ROW_RIGHT,
4_COLUMN,
4_VERTICAL,
5_ROW_LEFT,
5_ROW_LEFT_LOOSE,
5_ROW_RIGHT,
5_ROW_RIGHT_LOOSE,
5_COLUMN,
5_VERTICAL,
5_VEE,
7_VEE,
9_VEE,
16_ROW_LEFT,
16_ROW_RIGHT,
16_COLUMN_LOOSE,
16_COLUMN_TIGHT,
80M_ROAD_NODE_16_TANKS,
TARAWA_HELICOPTER_LANDING_SITES,
KIEV_HELICOPTER_LANDING_SITES,
Here is the complete list of valid components:
HELICOPTER_SCOUT_GROUP,
HELICOPTER_STRIKE_GROUP,
HELICOPTER_ESCORT_GROUP,
HELICOPTER_RECON_GROUP,
HELICOPTER_MARINE_ASSAULT_GROUP,
HELICOPTER_MEDIUM_LIFT_GROUP,
HELICOPTER_HEAVY_LIFT_GROUP,
FIXED_WING_CLOSE_AIR_SUPPORT_GROUP,
FIXED_WING_MULTI_ROLE_GROUP,
FIXED_WING_CARRIER_BORNE_STRIKE_GROUP,
FIXED_WING_CARRIER_BORNE_INTERCEPTOR_GROUP,
PRIMARY_FRONTLINE_GROUP,
SECONDARY_FRONTLINE_GROUP,
HEAVY_SAM_AAA_GROUP,
LIGHT_SAM_AAA_GROUP,
INFANTRY_SAM_GROUP,
ARTILLERY_GROUP,
MLRS_GROUP,
INFANTRY_GROUP1,
INFANTRY_GROUP2,
AIRCRAFT_CARRIER_GROUP,
FRIGATE_GROUP,
LANDING_GROUP,
Placing vehicles at bases won't have the desired effect... 'landed' vehicles cannot
attack until they 'takeoff'.. that applies to anything, aircraft, vehicles, ships. Around
each base is a number of defined routes, one for landing, one for taking off, etc...
before anything can start engaging, it must fly/drive the takeoff route.
CUBA.BIN
There use to be a PSD layer (like the .SID file) for
the SAM/AAA placement but it was combined into the CUBA.BIN file. The composition of the
bin file is binary, but it is possible to play around with it.
The bin file is split into sections. Each section will have a size and a data part.
Looking through it would be too difficult to tweak values but luckily the very last
section is to do with SAM/AAA placement. The section is stored as:
[number_of_sam/aaa]
[x_position]
[z_position]
[x_position]
[z_position]
...
...
So if you wrote a program that worked backwards from the end of the file, reading in
4_BYTE float values until you get to a value that looks like the 'number_of_sam/aaa' (you
could calculate what the value should be). By default, the value for Cuba is 110 and
Georgia is 93, that should help you locate it. Then all you need to do is alter the count
and write out the new positions... the side of the SAM/AAA is determined by the sector
side.
The easiest way to increase the number of SAM/AAA units is to change the formation
data. The group type is:
ENTITY_SUB_TYPE_GROUP_ANTI_AIRCRAFT
And the formation is:
FORMATION_COMPONENT_LIGHT_SAM_AAA_GROUP.
Ground forces also get their side from the sector side info... same for the FARPs. The
map is actually covered with possible FARP positions. FARPs can only exist along the
frontline and as the game progresses the frontline moves, enabling new FARPs and disabling
old ones. When a sector with a FARP in is captured the FARP starts to shutdown. This
allows the enemy to possibly capture it and use it for itself - you'll sometimes see
helicopters on FARP_RECON missions... this mission is used to enable a new FARP site.
The hotspot layers are to do with the sector_objective... there are two layers because
it is possible to have different objectives for each side. You should find that if you
alter the blue hotspot layer and run the game, blue force objective sectors will change...
although not the count on the status screen (that's done in the script file so if you
change one, don't forget to change the other).
CAMPAIGN.POP
The .POP files are used to create keysites without the .BIN file. The main campaigns
(cuba.cmp etc) don't use them anymore but special games do (mult3.spc). All it does is
create a keysite, create the landing routes for various types (helicopter, fixed_wing,
ship or routed_vehicles) and place buildings. You could build a new base using the pop
file and tell the campaign file to load it... have a look at mult3.spc where it specifies
the filename mult3.pop.
Completion criteria for the campaigns (or any game) can be any of the following... you
can see from the .CMP file how they are used. The game checks every couple of seconds to
see if all the criteria has been fulfilled, if they have the game ends with the specified
'result'.
For each, here are the parameters that must be supplied:
CAMPAIGN_CRITERIA_BALANCE_OF_POWER:
GOAL
RESULT
CAMPAIGN_CRITERIA_COMPLETED_TASKS:
CAMPAIGN_CRITERIA_FAILED_TASKS:
GOAL
TYPE
RESULT
CAMPAIGN_CRITERIA_DESTROYED_ALLIED_OBJECTS:
CAMPAIGN_CRITERIA_DESTROYED_ENEMY_OBJECTS:
GOAL
TYPE
RESULT
CAMPAIGN_CRITERIA_INEFFICIENT_ALLIED_KEYSITES:
CAMPAIGN_CRITERIA_INEFFICIENT_ENEMY_KEYSITES:
GOAL
TYPE
RESULT
CAMPAIGN_CRITERIA_SURRENDERED_SIDES:
GOAL
RESULT
CAMPAIGN_CRITERIA_SECTOR_REACHED:
GOAL
X_SECTOR
Z_SECTOR
RESULT
CAMPAIGN_CRITERIA_REACHED_WAYPOINTS:
GOAL
TYPE
RESULT
CAMPAIGN_CRITERIA_TIME_DURATION:
DAYS
HOURS
MINUTES
SECONDS
RESULT
CAMPAIGN_CRITERIA_CAPTURED_SECTORS:
CAMPAIGN_CRITERIA_LOST_SECTORS:
GOAL
RESULT
CAMPAIGN_CRITERIA_ENEMY_FIRED:
GOAL
RESULT
So, for example if you wanted to make a special game in which you had to avoid being
detected by the enemy but destroy their base you could use:
For blue only (no need for red criteria in this case!)
:CAMPAIGN_CRITERIA
:CRITERIA_DESTROYED_ENEMY_OBJECTS
:GOAL 1
:TYPE OBJECT_3D_LAST
:RESULT SUCCESS
:CAMPAIGN_CRITERIA
:CRITERIA_ENEMY_FIRED
:GOAL 1
:RESULT FAILURE
You could add a timer (5 minutes) with ...
:CAMPAIGN_CRITERIA
:CRITERIA_TIME_DURATION
:DAYS 0
:HOURS 0
:MINUTES 5
:SECONDS 0
:RESULT FAILURE
There are a lot of things you can do with this. There used to be a special game in
which you had to hover within a big transparent sphere for a 10 seconds within a time
limit... it was really quite hard. Special games are probably the best way to practice and
I think will allow the most scope.
Map positions are calculated from the bottom left of the map. You can calculate the
size of the map from the data in the .CMP file.
The hotspot layers are the same at the moment because both sides objective sectors are
the same.... they don't have to be though... try changing blues to cover the entire map
except a little bit in the middle and you'll see what I mean (hopefully!)
The warmth layers are purely used by the ground forces for when they are deciding which
direction to travel. Imagine a group of tanks at a road junction with 2 directions of
possible travel; the warmth map just helps the decision.
The background layer is only used to define the side of the sectors. Although other
things use the sector sides to define their side.
The hotspot layers are the only ones used to set the objective sectors. So, in the
blue_hotspot layer colour the whole thing in blue and see what happens in the game... you
should see that the whole map is covered by objective sectors. By intelligently altering
the hotspot layers you can change how difficult it is to complete a campaign (although you
could just reduce the number of required objective_sectors in the cmp file !)
The only reason the red and blue layers are the same is to make the two sides appear to
battle for sectors... if they were different blue would go off in one direction to capture
its sectors while red would concentrate on getting its. Having then on top of one another
makes each side try and capture the same sector. If that makes sense !?
The easiest way to add campaigns is to copy the cmp file, changing the titles to New
Cuban Crisis (or whatever). Then the game will pick them up as different campaigns.
In the FORMCOMP.DAT file (and all
script files) the double slash // designates a comment line.
Looking through the .DAT file it is pretty straightforward.
- The first "type" is the name of the formation_components.
- The second "type" is the name of the formation (from forms.dat).
- The "count" is the number of aircraft (or whatever) in the formation.
- Then comes the group type (from the valid ones listed at the start of the section).
- Finally the actual aircraft types, listed Blue, Red, Blue, Red etc...
The only thing to be careful of is to make sure that the "count" (x2 for
Blue/Red) is the same as the number of aircraft listed.
|